package com.cy.pj.common.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/*借助此对象在业务逻辑层封装分页信息*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageObject<T> implements Serializable {
    private static final long serialVersionUID = -8770600233998974797L;//序列化
    //总记录数
    private Integer rowCount;
    //当前页记录
    private List<T> records;//new PageObject<SysUser>(),new PageObject<SysRole>()
    //总页数
    private Integer pageCount;
    //每页最多显示多少条记录
    private Integer pageSize;
    //记录当前页的页码值
    private Integer pageCurrent;

/*    public PageObject(Integer rowCount, Integer pageCount, Integer pageSize) {
        this.rowCount = rowCount;
        this.pageCount = pageCount;
        this.pageSize = pageSize;
        pageCount=rowCount/pageSize;
        if (rowCount%pageSize!=0)pageCount++;
    }*/
}
